﻿<Window x:Class="LongBar.Flyout"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Flyout" Height="300" Width="400" Topmost="True" ShowInTaskbar="False" ResizeMode="NoResize"  AllowsTransparency="True" WindowStyle="None" Background="Transparent">
    <Window.Resources>
        <ContextMenu x:Key="Menu">
            <MenuItem Name="AlwaysShowItem" Header="{DynamicResource AlwaysShow}" IsCheckable="True"/>
            <MenuItem Name="CloseItem" Header="{DynamicResource FlyoutClose}" Click="CloseItem_Click"/>
        </ContextMenu>
        <DoubleAnimation x:Key="LoadAnimLeft" Storyboard.TargetProperty="Left" AccelerationRatio="0.3" Duration="0:0:0.15"/>
        <DoubleAnimation x:Key="LoadAnimOpacity" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.15" Completed="DoubleAnimation_Completed"/>
    </Window.Resources>
    <Grid Name="Grid">
        <Rectangle Name="Border" Style="{DynamicResource FlyoutBorder}"/>
        <Rectangle Name="Fill" Style="{DynamicResource FlyoutFill}"/>
        <Rectangle Name="Highlight" Style="{DynamicResource FlyoutHighlight}"/>
        <Grid Name="ContentGrid" Style="{DynamicResource FlyoutContent}"/>
        <StackPanel Name="SysMenu" Background="#00000000" VerticalAlignment="Top" Orientation="Horizontal" Height="25" FlowDirection="RightToLeft" Margin="0,0,5,0" >
            <StackPanel.Triggers>
                <EventTrigger RoutedEvent="StackPanel.MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="DropDownButtonFill" Storyboard.TargetProperty="Color" To="White" Duration="0:0:0.3"/>
                            <DoubleAnimation Storyboard.TargetName="DropDownTextBlock" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="StackPanel.MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="DropDownButtonFill" Storyboard.TargetProperty="Color" To="Gray" Duration="0:0:0.3"/>
                            <DoubleAnimation Storyboard.TargetName="DropDownTextBlock" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.3"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </StackPanel.Triggers>
            <Polygon Name="DropDownButton" VerticalAlignment="Top" Margin="0,7,0,0" Opacity="1" Points="0,0 5,6 10,0" Stroke="Black" StrokeThickness="1" Width="10" Height="6" MouseLeftButtonDown="DropDownMenu_MouseLeftButtonDown">
                <Polygon.Fill>
                    <SolidColorBrush x:Name="DropDownButtonFill" Color="Gray"/>
                </Polygon.Fill>
            </Polygon>
            <TextBlock Name="DropDownTextBlock" VerticalAlignment="Top" Opacity="0" Margin="5,0,5,0" Text="{DynamicResource FlyoutOptions}" Foreground="White" FontSize="12" MouseLeftButtonDown="DropDownMenu_MouseLeftButtonDown"/>
        </StackPanel>
    </Grid>
</Window>
